package com.cqu.hhx.driver.service;

import com.cqu.hhx.driver.entity.DoingOrder;
import com.cqu.hhx.driver.entity.Driver;
import com.cqu.hhx.driver.entity.FinishOrder;
import com.cqu.hhx.driver.entity.NewOrder;
import com.cqu.hhx.driver.entity.forWeb.Evaluation;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author DJ
 * @create 2020-05-24 22:28
 * 订单服务接口
 */
public interface OrderService {
    //乘客添加新的订单
    public Integer addNewOrder(NewOrder newOrder);
    //请求所有的新下单订单
    public List<NewOrder> getAllNewOrder();
    //通过订单Id查询下单订单信息
    public NewOrder getNewOrderByOrderId(Long orderId);
    //通过订单Id删除下单订单信息
    public int deleteNewOrderByOrderId(Long orderId);
    //添加进行中订单
    public Integer addDoingOrder(DoingOrder order);
    //乘客获取进行中订单信息
    public DoingOrder customerGetDoingOrder(Long customerId);
    //乘客获取新订单
    public NewOrder customerGetNewOrder(Long customerId);
    //司机获取进行中订单信息
    public DoingOrder driverGetDoingOrder(Long driverId);
    //通过订单Id删除进行中订单信息：订单完成后触发
    public int deleteDoingOrderById(Long orderId);
    //新建已完成订单
    public int addFinishOrder(FinishOrder finishOrder);
    //乘客评价订单
    public int evaluateOrder(Evaluation evaluation);
    //乘客获取已完成订单
    public List<FinishOrder> customerGetFinishOrders(Long customerId);
    //司机获取已完成订单
    public List<FinishOrder> driverGetFinishOrders(Long driverId);
    //管理员删除订单
    public int deleteFinishOrder(Long orderId);
    //计算司机评分平均值
    public Float computeDriverAvaScore(Long driverId);

    //通过Id获取司机信息
    public Driver getDriverInfoById(Long driverId);
    //更新乘客账户余额
    public Float updateCustomerMoney(Long customerId,Float price,Boolean isAdd);
    //更新司机账户余额
    public Float updateDriverMoney(Long driverId,Float price,Boolean isAdd);

}
